﻿@model CustomerServiceCenter.Models.TicketWeiXinModel
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta charset="UTF-8" name="viewport" content="width=device-width" />
    <title>评价</title>
    <link href="~/Content/font-awesome.min.css" rel="stylesheet" />
    <link href="~/content/bootstrap.min.css" rel="stylesheet" />
    <link href="~/content/wechat/basic.css" rel="stylesheet" />
    <link href="~/content/wechat/EvaluatePage.css" rel="stylesheet" />
</head>
<body>
    <div class="container">
        <div class="sth clearfix">
            <div class="tag style-bg-green"></div>
            <input id="ticketID" type="hidden" value="@Model.TicketID" />
            <div class="clearfix">
                <label for="time" class="col-xs-4">提交时间</label>
                <p id="time" class="col-xs-8">@string.Format("{0:yyyy年MM月dd日 HH:mm}", Model.SubmitDate)</p>
            </div>
            <div class="clearfix">
                <label for="details" class="col-xs-4">问题描述</label>
                <p id="details" class="col-xs-8">@Model.IssueDescription</p>
            </div>
            <div class="clearfix">
                <label for="orderNo" class="col-xs-4">订单号</label>
                <p id="orderNo" class="col-xs-8">@Model.OrderNumber</p>
            </div>
            <div class="clearfix">
                <label for="person" class="col-xs-4">技术专员：</label>
                <p id="person" class="col-xs-8">@Model.AssignerName</p>
            </div>
        </div>
        <div class="eva clearfix">
            <div class="tag style-bg-green"></div>
            <span style="color: #D7D7D7;">3天内不评价将默认五星</span>
            <div class="clearfix">
                <h5 class="col-xs-10 col-xs-offset-1 txt-center">对本次服务的感觉如何</h5>
            </div>
            <div class="col-xs-10 col-xs-offset-1">
                <i id="1" class="fa fa-star style-green"></i>
                <i id="2" class="fa fa-star style-green"></i>
                <i id="3" class="fa fa-star style-green"></i>
                <i id="4" class="fa fa-star style-green"></i>
                <i id="5" class="fa fa-star style-green"></i>
            </div>
            <hr class="col-xs-10 style-gray" />
            <div class="con col-xs-12">
                <textarea name="ServiceComments" id="ServiceComments" class="col-xs-12" placeholder="请写下对本次服务的感受吧，对他人帮助很大哦！"></textarea>
            </div>
        </div>
    </div>
    <footer class="col-xs-12">
        <button id="submitComments" class="subEva col-xs-12 style-bg-blue">发布评价</button>
    </footer>
    <script src="~/scripts/jquery-1.8.2.min.js"></script>
    <script type="text/javascript">
        var itemId = 5;     //默认五星评分
        $(function () {
            //var jsonEvalDetails = $.cookie("evalDetails");
            //var evalDetails = JSON.parse(jsonEvalDetails);
            //ticketId = evalDetails.ticketID;
            //$("#time").html(evalDetails.submitDate);
            //$("#details").html(evalDetails.issueDesciption);
            //$("#orderNo").html(evalDetails.orderNumber);
            //$("#person").html(evalDetails.assignerName);
            //$("#mobile").html(ticketDetails.mobile);

            $("#submitComments").click(function () {
                $.ajax({
                    url: "../WeChat/MakeComments",
                    type: 'post',
                    data: { "ticketId": $("#ticketID").val(), "ServiceRate": itemId, "ServiceComments": $("#ServiceComments").val() },
                    success: function (data) {
                        location.href = "../WeChat/HomePage";
                    },
                    error: function (err) {
                        alert('网络故障');
                    }
                });
            });
        });



        $(".fa-star").click(function () {
            $(".fa-star").removeClass("style-gray");
            $(".fa-star").addClass("style-green");
            $(this).nextAll().addClass("style-gray");
            itemId = $(this).attr("id");
        });



    </script>
</body>
</html>
